package com.kly.sc.api.application;

import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil;

public class Test01 {
    public static void main(String[] args) {
        // 获取明天0点的时间
        DateTime endTime = DateUtil.beginOfDay(DateUtil.offsetDay(DateUtil.date(), 3));

        // 获取当前时间
        DateTime nowTime = DateUtil.date();

        // 计算剩余时间
        long hours = DateUtil.between(nowTime, endTime, DateUnit.HOUR, false);
        long minutes = DateUtil.between(nowTime, endTime, DateUnit.MINUTE, false) % 60;

        long seconds = DateUtil.between(nowTime, endTime, DateUnit.SECOND, false) % 60;
        System.out.println("距离明天0点还有：" + hours + "小时" + minutes + "分钟" + seconds + "秒");

        long seconds1 = DateUtil.between(nowTime, endTime, DateUnit.SECOND, false);
        System.out.println("距离明天0点还有：" + seconds1 + "秒");


        long l1=1686996621656l;
        long l2=1687011115354l;
        System.out.println((l2-l1)/1000);
    }
}
